﻿using Newtonsoft.Json;
using QuickPasteToolWeb.Helper;
using QuickPasteToolWeb.Infrastructure;
using QuickPasteToolWeb.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;

namespace QuickPasteToolWeb.Service
{
    public class SettingService : ISettingService
    {
        public void DefaultSetting()
        {
            throw new NotImplementedException();
        }

        public SettingModel GetSetting()
        {
            return SettingHelper.GetSetting();
        }

        public void SaveSetting(SettingModel settingModelStr)
        {
            var settingModel = JsonConvert.SerializeObject(settingModelStr);
            var path = QuickPasteConst.UserSettingPath;
            File.WriteAllText(path, settingModel);
        }
    }
}
